function Main() {

	this.init = function() {
		if (ui == null) {
			ui = new Ui();
		}

		ui.init();
	};

	this.getErrorMessage = function(error) {
		var message;

		switch (error.type) {
		case "2":
			message = labels.errors[error.type];
			break;
		case "4":
			message = labels.errors[error.type];
			message = message
					.replace("{fieldName}", labels.fields[error.field]);
			break;
		case "5":
			message = labels.errors[error.type];
			message = message
					.replace("{fieldName}", labels.fields[error.field]);
			break;
		case "6":
			message = labels.errors[error.type];
			message = message
					.replace("{fieldName}", labels.fields[error.field]);
			message = message.replace("{maximum}", error.maximum);
			break;
		case "7":
			message = labels.errors[error.type];
			break;
		case "8":
			message = labels.errors[error.type];
			message = message
					.replace("{fieldName}", labels.fields[error.field]);
			break;
		default:
			message = error.message;
		}

		return message;
	};

}
